﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using Service;
using Service.Infrastructure.Interface;
using SystmicFunction.IRMHelper;

namespace Web.Controllers
{
    public class HomeController : Base
    {
        public IAccount im = ServiceFactory.GMember();

        // GET: /Home/
        [HttpGet]
        public ActionResult Index()
        {
            return View();
        }

        


        [HttpGet]
        public ActionResult DataIn(String key, String data)
        {
            if (!String.IsNullOrEmpty(key) && data != null)
            {
                while (true)
                {
                    var worker = new Worker
                    {
                        Key = "s1",
                        Data = "Se7enS1111111111" + "Time:" + DateTime.Now.ToString(),
                    };
                    var workThread = new Thread(worker.SetResult);
                    workThread.Start();

                    var worker2 = new Worker
                    {
                        Key = "s2",
                        Data = "Se7enS22222222" + "Time:" + DateTime.Now.ToString(),
                    };
                    var workThread2 = new Thread(worker.SetResult);
                    workThread2.Start();
                }
            }
            return View();
        }

        [HttpPost]
        public ActionResult Index(HttpPostedFileBase file)
        {
            im.Login("", "");
            return View();
        }


        public ActionResult Async(String sessionId, String message)
        {
            return View();
        }

    }
}
